package com.ruoyi.api.controller;

import com.alibaba.fastjson.JSON;
import com.ruoyi.api.vo.SimplePost;
import com.ruoyi.result.ResultView;
import com.ruoyi.system.service.ISysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: lvaitly
 * Time: 15:17
 * Desc: 岗位相关
 */
@RestController
@RequestMapping("/api/post")
public class PostController {
    @Autowired
    private ISysPostService postService;
    @PostMapping("/list")
    private ResultView getList(){
        return ResultView.ok(JSON.parseArray(JSON.toJSONString(postService.selectPostAll()), SimplePost.class));
    }
}
